<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .inputBox{
            margin: 10px;
            display:flex;
            align-items: center;
        }
        .inputBox input{
            flex: 1;
            height: 40px;
            background: rgb(193, 190, 190);
            border: none;
            outline: none;
            padding-left: 10px;
            border-radius: 10px;
        }
        .inputBox span{
            width: 60px;
            text-align: center;
            color: black;
            font-size: 24px;
        }
        .summary{
            display: flex;
            margin: 10px;
            align-items: center;
            justify-content: space-between;
        }
        .summary span{
            display: inline-block;
            padding: 10px;
            background: aquamarine;
            border-radius: 10px;
        }
        .summary span:nth-child(3){
            background-color: red;
        }
        .list h3{
            margin: 10px 0;
            margin-left: 10px;
        }
        .taskList{
            display: flex;
            height: 40px;
            margin: 10px;
            background: aquamarine;
            justify-content: space-between;
        }
        .taskList input{
            margin-left: 10px;
        }
        .taskList span{
            line-height: 40px;
            display: inline-block;
            margin:0 10px;
        }
        .empty{
            height: 100px;
            line-height: 100px;
            margin: 10px;
            text-align: center;
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="inputBox">
            <input type="text" placeholder="输入任务名称" v-model="inputText">
            <span @click="addTask()">新增</span>
        </div>
        <div class="summary">
            <span>全部任务({{TaskList.length}})</span>
            <span>已完成({{TaskList.length-unFinish}})</span>
            <span>未完成({{unFinish}})</span>
        </div>
        <div class="list">
            <h3>任务列表</h3>
            <div :style="{backgroundColor: item.status==false?'aquamarine':'orange'}" class="taskList" v-for="(item,index) in TaskList">
                <div>
                    <input type="checkbox" :checked="item.status" @click="change(item)">
                    <span>{{item.id}}</span>
                    <span>{{item.name}}</span>
                </div>
                <span @click="del(index)">删除</span>
            </div>
        </div>
        <div v-show="TaskList.length==0" class="empty">
            任务列表为空，请添加一项任务~
        </div>
    </div>


    <script src="vue.js"></script>
    <script src="TodoList.js"></script>
</body>
</html>